<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8"/>
    <title></title>
    <script type="text/javascript" src="http://cart.gulimall.com/static/cart//js/jquery-3.1.1.min.js"></script>
    <script type="text/javascript" src="http://cart.gulimall.com/static/cart//bootstrap/js/bootstrap.js"></script>
    <script type="text/javascript" src="http://cart.gulimall.com/static/cart/js/swiper.min.js"></script>

    <link rel="stylesheet" type="text/css" href="http://cart.gulimall.com/static/cart//css/swiper.min.css"/>
    <link rel="stylesheet" type="text/css" href="http://cart.gulimall.com/static/cart//bootstrap/css/bootstrap.css"/>
    <link rel="stylesheet" type="text/css" href="http://cart.gulimall.com/static/cart//css/success.css"/>

</head>

<body>
<!--头部-->
<div class="alert-info">
    <div class="hd_wrap_top">
        <ul class="hd_wrap_left">
            <li class="hd_home"><i class="glyphicon glyphicon-home"></i>
                <a href="http://gulimall.com">谷粒商城首页</a>
            </li>

        </ul>

        <ul class="hd_wrap_right">
            <li style="winth: 150px;">
                <a th:if="${session.loginUser==null}" href="http://auth.gulimall.com/login.html" class="aa">请登录</a>
                <a th:if="${session.loginUser!=null}" class="aa"
                   style="width:100px">[[${session.loginUser.nickName}]]</a>
            </li>
            <li><a th:if="${session.loginUser==null}" href="http://auth.gulimall.com/reg.html"
                   style="color: red;">免费注册</a>
            <li class="spacer"></li>

            <li>
                <a href="http://cart.gulimall.com//javascript:;">我的订单</a>
            </li>

        </ul>

    </div>
</div>

<div class="nav-tabs-justified">
    <div class="nav_wrap">

        <div class="nav_top">
            <div class="nav_top_one">
                <a href="http://gulimall.com"><img src="http://cart.gulimall.com/static/cart/img/logo1.jpg"
                                                   style="height: 60px;width:180px;"/></a>
            </div>
            <div class="nav_top_two"><input type="text"/>
                <button>搜索</button>
            </div>
        </div>

    </div>
</div>

<div class="main">
    <div class="success-wrap">
        <div class="w" id="result">
            <h class="m succeed-box">
<!--                <h2>正在准备订单数据，<span style="color: #ff3324" id="dd">10</span>秒后自动跳转支付  </h2>-->

                    <div th:if="${orderSn != null}" class="mc success-cont">
                        <h1>恭喜，秒杀成功，订单号
                            <span id="orderId">[[${orderSn}]]</span>
                        </h1>

                        <h2>正在准备订单数据，<span style="color: #ff3324" id="dd">10</span> 秒后自动跳转支付
                            <a style="color: red"
                               th:href="${'http://order.gulimall.com/payOrder?orderSn='+orderSn}">去支付</a>
                        </h2>
                    </div>

                    <div th:if="${orderSn == null}" class="mc success-cont">
                        <h1>手气不好下次再来</h1>
                    </div>
            </h>
            </div>
        </div>
    </div>

</div>
</body>
<script type="text/javascript" src="http://cart.gulimall.com/static/cart//js/success.js"></script>
<script>
    window.onload = function () {
        setInterval(function () {
            var s = document.getElementById("dd");
            var orderId = document.getElementById("orderId").innerHTML;
            if (s.innerHTML == 0) {
                 window.location.href = 'http://order.gulimall.com/payOrder?orderSn=' + orderId;
                return false;
            }
            s.innerHTML = s.innerHTML * 1 - 1;
        }, 1000);
    }
</script>

</html>
